package com.yanqu.road.server.gameplayer.module.activity.tomb.service;

import com.google.protobuf.InvalidProtocolBufferException;
import com.yanqu.road.pb.syncMessage.SyncMessage;
import com.yanqu.road.pb.tomb.Tomb;
import com.yanqu.road.server.game.service.IGameServiceCommand;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.tomb.TombMgr;
import com.yanqu.road.server.gameplayer.module.activity.tomb.TombModule;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.sync.message.SyncResponse;

import java.util.List;

public class TombServerTopPatronsServiceCmd implements IGameServiceCommand {
    @Override
    public SyncResponse execute(SyncMessage.Request request) throws InvalidProtocolBufferException {
        //拿出分组
        Tomb.TombServerTopPatronsReq req = Tomb.TombServerTopPatronsReq.parseFrom(request.getDataBytes());

        SyncResponse syncResponse = new SyncResponse();
        Tomb.TombServerTopPatronsResp.Builder builder = Tomb.TombServerTopPatronsResp.newBuilder();
        builder.addAllList(TombMgr.findTopPatrons(req.getActivityId(), req.getGroupId()));
        syncResponse.setResponseBuilder(builder);
        return syncResponse;
    }
}
